package factory.simple;

/**
 * @description: 简单工厂模式，专门定义一个类用来负责创建其他类的实例，被创建的实例通常都具有相同的父类
 * @author: Fesine
 * @createTime:2016/8/8 19:47
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/8/8 19:47
 */
public class Main {
    public static void main(String[] args) {
        BaseGF siChuanGirl = GFFactory.createGF(GFType.SI_CHUAN);
        siChuanGirl.eatFood();
        siChuanGirl.shopping();

        Animal cat = AnimalFactory.createAnimal(AnimalType.CAT);
        cat.sayHello();
        cat.sound();
        Animal dog = AnimalFactory.createAnimal(AnimalType.DOG);
        dog.sayHello();
        dog.sound();
        Animal duck = AnimalFactory.createAnimal(AnimalType.DUCK);
        duck.sayHello();
        duck.sound();
    }
}
